-
Notifications
You must be signed in to change notification settings - Fork 789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize Filename.checkPathForIllegalChars #1662
Optimize Filename.checkPathForIllegalChars #1662
Conversation
Do we really want to cache tested paths for the run of the program just to speed up 'Filename.checkPathForIllegalChars'. Especially since I assume most apps are going to go to the disk after the check which will undoubtedly consume vast amounts more clock time than this little function. Perhaps I am wrong though .... what do you think? Kevin |
@KevinRansom did you check the linked issue in fsharp/fsharp-compiler-docs#659 AFAIK this is mainly a FCS issue but we probably want to keep code synced whenever possible. |
@forki, |
I agree keeping the core code aligned between the compilerservice and the compiler is essential. E.g if ionide uses chopextension fixing this would halve the number of calls Also as for the comment ' // for OCaml compatibility' I don't know why that is interesting.
|
@vasily-kirichenko The PR is good, I'll reopen :) thanks |
@KevinRansom Agreed we should work out why this is being called so often - people keep reporting this from time to time as being top of profiling traces. Also just cleaning up the legacy helpers and using standard .NET ones is good too. This fix itself is good enough for now, once it's green lets merge it. |
@dsyme It's a grow only cache and therefore bad, especially for long running apps. Large F# solutions inside VS would particularly suffer from this creeping memory bloat. Perhaps we should: I shall revert this change ... I realize there is a problem ... but we need a solution that will not grow our memory in a big way Kevin |
How many files does the compiler see during the life time? How often have we cache hits? |
This reverts commit 9753f72.
I think this cache may improve performance of VFT (IDE), not the compiler. |
Yeah I meant that compiler as a service/ VS integration. Am 27.10.2016 20:46 schrieb "Vasily Kirichenko" notifications@github.com:
|
@forki @vasily-kirichenko I don't doubt that this change will speed up validation of paths already seen. I expect that we validate already seen paths too many times. It is hard to explain how this functionality in the normal use of a compiler or even an IDE can get to the top of any performance graph. Since it seems to indicate that we are about to do IO. I'm just suggesting that before we work on improving this function we look to see if we are not it using too aggressively. An easy example that took less than a minute to find was in cropExtension, where we caused it to be invoked twice per string. https://github.com/Microsoft/visualfsharp/pull/1666/files I expect the proper solution is to look carefully at where we use this API and see if it is really necessary, or where we can reduce the number of times it is invoked. After all not invoking the function will save us a hashing and a table look up. Does that make sense ? Kevin |
Okay: I metered these functions, compiling fsharp.core.dll this is the usage count:
before my earlier check-in for chopExtension it would have been and extra 63 so 1010. This is not really a large number of invocations so any reductions in the compiler are unlikely to noticeably reduce compile time. Someone needs to look at why it pops so high when you use the compiler server from an IDE. I will continue to see what I can do to drive the number of validations down here in the compiler. But I think the issue has to be elsewhere. |
@forki @vasily-kirichenko @dsyme It reduces the number of invocations for an fsharp.core.dll compile by about 75%. and is tiny :-) Let me know how these changes perform in your fcs scenarios, if you still have issues or need some help identifying possible improvements let me know and I will take a further look. Kevin |
No description provided.